package com.cj.netlibrary.okhttp

import com.cj.netlibrary.okhttp.interceptor.AddRequestHeaderInterceptor
import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor

/**
 *created by chen jun
 *on 2021/5/25 10:12
 */
object OkHttpManager {
     val okHttpClient by lazy {
        OkHttpClient
            .Builder()
            .addInterceptor(AddRequestHeaderInterceptor())//添加通用的请求头
            .addInterceptor(HttpLoggingInterceptor().apply {
                level = HttpLoggingInterceptor.Level.BODY
              })//过滤请求和响应的日志
            .build()
    }
}